home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: May 29, 1997
- // Author: ajp
- //
- // Procedure Name:
- // AEextrudeTemplate
- //
- // Description Name;
- // Creates the attribute editor controls for the extrude node
- //
- // Input Value:
- // nodeName
- //
- // Output Value:
- // None
- //
-
-
- global proc extrudeTypeControls( string $nodeName )
- {
- string $typeAttrName = $nodeName + ".extrudeType";
- int $typeValue = `getAttr $typeAttrName`;
-
- if ( $typeValue == 0 )
- {
- // distance extrude type
- editorTemplate -dimControl $nodeName "useProfileNormal" false;
- editorTemplate -dimControl $nodeName "fixedPath" true;
- editorTemplate -dimControl $nodeName "length" false;
- editorTemplate -dimControl $nodeName "degreeAlongLength" false;
-
- // for direction dimming
- useProfileNormalControls( $nodeName );
- }
- else if ( $typeValue == 1 )
- {
- // flat extrude type
- editorTemplate -dimControl $nodeName "useProfileNormal" true;
- editorTemplate -dimControl $nodeName "fixedPath" false;
- editorTemplate -dimControl $nodeName "direction" true;
- editorTemplate -dimControl $nodeName "length" true;
- editorTemplate -dimControl $nodeName "degreeAlongLength" true;
- }
- else
- {
- // tube extrude type
- editorTemplate -dimControl $nodeName "useProfileNormal" false;
- editorTemplate -dimControl $nodeName "fixedPath" false;
- editorTemplate -dimControl $nodeName "direction" true;
- editorTemplate -dimControl $nodeName "length" true;
- editorTemplate -dimControl $nodeName "degreeAlongLength" true;
-
- // for direction dimming
- useProfileNormalControls( $nodeName );
- }
-
- // for pivot dimming
- useComponentPivotControls( $nodeName );
- }
-
- global proc useProfileNormalControls( string $nodeName )
- {
- int $useNormalValue = 1;
-
- string $needUseDir = $nodeName + ".extrudeType";
- int $useDir = `getAttr $needUseDir`;
-
- if( 0 == $useDir ) {
- string $useNormalAttrName = $nodeName + ".useProfileNormal";
- $useNormalValue = `getAttr $useNormalAttrName`;
- }
-
- if ( $useNormalValue == 0 )
- {
- // need to specify a direction
- editorTemplate -dimControl $nodeName "direction" false;
- }
- else
- {
- // no need to specify a direction since using profile normal
- editorTemplate -dimControl $nodeName "direction" true;
- }
- }
-
- global proc useComponentPivotControls( string $nodeName )
- {
- string $usePivotAttrName = $nodeName + ".useComponentPivot";
- int $usePivotValue = `getAttr $usePivotAttrName`;
-
- if ( $usePivotValue == 1 )
- {
- // can't use specified pivot (uses start of path instead)
- editorTemplate -dimControl $nodeName "pivot" false;
- }
- else
- {
- // can use specified pivot
- editorTemplate -dimControl $nodeName "pivot" true;
- }
- }
-
- global proc AEextrudeTemplate( string $nodeName )
- {
- int $advMod = `licenseCheck -m edit -typ model`;
- editorTemplate -beginScrollLayout;
-
- editorTemplate -beginLayout "Extrude History" -collapse false;
- editorTemplate -callCustom "AEinputNew \"Profile Curve\""
- "AEinputReplace \"Profile Curve\""
- "profile";
- editorTemplate -callCustom "AEinputNew \"Path Curve\""
- "AEinputReplace \"Path Curve\""
- "path";
-
- editorTemplate -addControl "extrudeType" "extrudeTypeControls";
- editorTemplate -beginNoOptimize;
- editorTemplate -addControl "useComponentPivot" "useComponentPivotControls";
- editorTemplate -addControl "useProfileNormal" "useProfileNormalControls";
- editorTemplate -endNoOptimize;
- editorTemplate -addControl "fixedPath";
- editorTemplate -addControl "direction";
- editorTemplate -addControl "length";
- editorTemplate -addControl "pivot";
-
- if( $advMod ) {
- editorTemplate -addControl "rotation";
- editorTemplate -addControl "scale";
- }
- editorTemplate -addControl "degreeAlongLength";
- editorTemplate -endLayout;
-
- // include/call base class/node attributes
- AEabstractBaseCreateTemplate $nodeName;
-
- editorTemplate -addExtraControls;
- editorTemplate -endScrollLayout;
-
- editorTemplate -suppress "profile";
- editorTemplate -suppress "path";
- if( ! $advMod ) {
- editorTemplate -suppress "rotation";
- editorTemplate -suppress "scale";
- }
- }
-